<link rel="stylesheet" href="/css/home.css">
<style>
    .quick-links{ padding-left: 0;}
    .quick-links li{ padding:0;margin:0;}
    .quick-links li a{outline: none;}
    .actives{background-color: #00a0e9;color: #ffffff;}
    .noactives{background-color: #ffffff;color: black;}
</style>
<div id="bd" class="index-body cf">
    <div class="col-main">
        <div class="main-wrap cf">
            <div class="m-top cf" id="profileDom">
                <table width="100%" border="0" cellspacing="0" cellpadding="20">
                    <tbody>
                        <tr>
                            <td>
                                <a  class="tad t1" tabid="report-initialBalance" data-right="InvBalanceReport_QUERY" tabtxt="注册人数" parentopen="true" rel="pageTab" href="#">
                                    <span>注册人数:<b>{{$data['user_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t2" tabid="report-cashBankJournal" data-right="SettAcctReport_QUERY" tabtxt="网点数" parentopen="true" rel="pageTab" href="#">
                                    <span>网点数:<b>{{$data['amdin_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t1" tabid="report-initialBalance" data-right="InvBalanceReport_QUERY" tabtxt="商品数" parentopen="true" rel="pageTab" href="#">
                                    <span>商品数:<b>{{$data['goods_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t2" tabid="report-cashBankJournal" data-right="SettAcctReport_QUERY" tabtxt="网点数" parentopen="true" rel="pageTab" href="#">
                                    <span>水票数:<b>{{$data['water_ticket_count']}}</b></span>
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <a  class="tad t1" tabid="report-initialBalance" data-right="InvBalanceReport_QUERY" tabtxt="待审核评论数" parentopen="true" rel="pageTab" href="/admin/goods/content/manage">
                                    <span>待审核评论数:<b>{{$data['activity_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t2" tabid="report-cashBankJournal" data-right="SettAcctReport_QUERY" tabtxt="优惠券数" parentopen="true" rel="pageTab" href="#">
                                    <span>优惠券数:<b>{{$data['coupon_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t1" tabid="report-initialBalance" data-right="InvBalanceReport_QUERY" tabtxt="销售额" parentopen="true" rel="pageTab" href="#">
                                    <span>销售额:<b>{{$data['order_amount_count']}}</b></span>
                                </a>
                            </td>
                            <td>
                                <a  class="tad t2" tabid="report-cashBankJournal" data-right="SettAcctReport_QUERY" tabtxt="订单数" parentopen="true" rel="pageTab" href="#">
                                    <span>订单数:<b>{{$data['order_count']}}</b></span>
                                </a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <i></i>
            </div>
            <div class="row chart-middle">
                <div class="col-md-6">
                    <div id="myChart5" style="height: 336px;"></div>
                </div>
                <div class="col-md-6">
                    <div id="myChart4" style="height: 336px;"></div>
                </div>
            </div>


        </div>
    </div>
    <div class="col-extra">
        <div class="extra-wrap">
                <ul class="nav nav-tabs">
                    <li style="width: 50%;padding: 0;text-align: center;" class="right_count actives" id="right_count_one" value="1">
                        <span  data-toggle="tab" style="width: 100%;">
                            商品销售
                        </span>
                    </li>
                    <li style="width: 50%;padding: 0;text-align: center;"  class="right_count noactives" id="right_count_two" value="2">
                        <span data-toggle="tab" style="width: 100%;">
                            网点销售额
                        </span>
                    </li>
                </ul>

            <div class="list" style="margin-top: 1%;">
                <ul id="right_count_ul_one">
                    <?php foreach($goods_data as $key=>$val){ ?>
                        <li>
                            <?php if($key == 0){?>
                                <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #F04134;">
                            <?php }elseif($key == 1){?>
                                <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #FFBF00;">
                            <?php }elseif($key == 2){?>
                                <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #52C41A;">
                            <?php }else{?>
                                <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #BFBFBF;">
                            <?php }?>
                                    <span style="display: block;color: white;height: 25px;line-height: 25px;text-align: center"> {{$key+1}}</span>
                                </span>
                            <a tabid="setting-goodsList" data-right="INVENTORY_QUERY" tabtxt="{{$val['goods_title']}}" parentopen="true" rel="pageTab" href="#" style="margin-left: 2%">{{$val['goods_title']}}</a>
                            <span style="padding-right: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{$val['goods_sales']}}</span>
                        </li>
                   <?php }?>
                </ul>
                <ul id="right_count_ul_two" style="display: none;">
                    <?php foreach($network_data as $key=>$val){ ?>
                    <li>
                        <?php if($key == 0){?>
                        <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #F04134;">
                            <?php }elseif($key == 1){?>
                            <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #FFBF00;">
                            <?php }elseif($key == 2){?>
                                <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #52C41A;">
                            <?php }else{?>
                                    <span style="border-radius: 50%;height: 25px;width: 25px;display: inline-block;background: #BFBFBF;">
                            <?php }?>
                                        <span style="display: block;color: white;height: 25px;line-height: 25px;text-align: center"> {{$key+1}}</span>
                                </span>
                            <a tabid="setting-goodsList" data-right="INVENTORY_QUERY" tabtxt="{{$val['name']}}" parentopen="true" rel="pageTab" href="#" style="margin-left: 2%">{{$val['name']}}</a>
                            <span style="padding-right: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{$val['sales_volume']}}</span>
                    </li>
                    <?php }?>
                </ul>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
<script type="text/javascript">
    var app = {};
    //柱状图
    var myChart5 = echarts.init(document.getElementById("myChart5"));
    var option5;

    var date_time={!! $date !!}
    var amount_data={!! $amount_data !!}
    var user_data={!! $user_data !!}

    option5 = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            data: date_time

        },
        yAxis: {
            type: 'value',
            name: "          前12个月销售额",
            nameTextStyle: {
                color: '#000',
                fontWeight: 'bold'
            }
        },
        series: [
            {
                name: '销售额',
                type: 'bar',
                color: '#00A3E0',
                data: amount_data
            },
        ]
    };

    if (option5 && typeof option5 === 'object') {
        myChart5.setOption(option5);
    }

    //柱状图
    var myChart4 = echarts.init(document.getElementById("myChart4"));
    var option4;

    option4 = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            data: date_time

        },
        yAxis: {
            type: 'value',
            name: "          前12个月注册人数",
            nameTextStyle: {
                color: '#000',
                fontWeight: 'bold'
            }
        },
        series: [
            {
                name: '注册人数',
                type: 'bar',
                color: '#00A3E0',
                data: user_data
            },
        ]
    };

    if (option4 && typeof option4 === 'object') {
        myChart4.setOption(option4);
    }

    $("#right_count_one").click(function(){
        $("#right_count_one").removeClass('noactives');
        $("#right_count_one").addClass('actives');
        $("#right_count_two").removeClass('actives');
        $("#right_count_two").addClass('noactives');
        $("#right_count_ul_one").show();
        $("#right_count_ul_two").hide();
    })

    $("#right_count_two").click(function(){
        $("#right_count_two").removeClass('noactives');
        $("#right_count_two").addClass('actives');
        $("#right_count_one").removeClass('actives');
        $("#right_count_one").addClass('noactives');
        $("#right_count_ul_one").hide();
        $("#right_count_ul_two").show();
    })

</script>